/**
 *  Copyright 2010 ShenYang voole Co. Ltd.
 *  All right reserved. 
 */
package com.dianning.dao;

import java.util.List;

import com.dianning.bean.AdAds;
import com.dianning.bean.AdSpace;
import com.dianning.bean.Admin;
import com.dianning.bean.Area;
import com.dianning.bean.Channel;
import com.dianning.bean.Credit;
import com.dianning.bean.Visitor;

/**
 * 功能描述:奖励记录操作接口
 *
 * 创建日期 Apr 10, 2010
 *
 * @author zhangbaochao
 *
 * @version 1.0
 *
 */
public interface CreditDAO {
	
	/**
	 * 保存Credit对象
	 * 
	 * @param credit
	 * 			Credit对象
	 * @return Credit
	 * 			Credit对象
	 */
	public Credit saveCredit(Credit credit);
	/**
	 * 保存或更新Credit对象
	 * 
	 * @param credit
	 * 			Credit对象
	 * @return Credit
	 * 			Credit对象
	 */
	public Credit saveOrUpdateCredit(Credit credit);
	/**
	 * 保存Credit对象
	 * 
	 * @param credit
	 * 			Credit对象
	 * @return Credit
	 * 			Credit对象
	 */
	public Credit updateCredit(Credit credit);
	
	/**
	 * 根据主键ID获取Credit对象
	 * 
	 * @param id
	 * 			主键ID
	 * @return Credit
	 * 			Credit对象
	 */
	public Credit findCreditById(long id);
	
	/**
	 * 获取Credit个数
	 * 
	 * @return int
	 * 			Credit个数
	 */
	public long getCreditNum();
	
	/**
	 * 获取Credit列表
	 * 
	 * @param orderby
	 *            String
	 * @param ascOrDesc
	 *            int
	 * @param firstResult
	 *            int
	 * @param maxResults
	 *            int
	 * @return List
	 * 			Credit对象列表
	 */
	public List findCredits(String orderby, int ascOrDesc, int firstResult, int maxResults);
	
	/**
	 * 根据code获取过期一天Credit对象
	 * @param code
	 * @return Credit
	 */
	public Credit findCreditByUidCodeDate(long uid,String code);
	
	/**
	 * 根据code获取过期一天Credit对象
	 * @param code
	 * @return Credit
	 */
	public Credit findCreditByUidCodeTime(long uid,String code);
	
	/**
	 * 根据code获取Credit对象
	 * @param code
	 * @return Credit
	 */
	public Credit findCreditByUidCode(long uid,String code);
}
